

%% baseline model

% aggregate data 1950-1999
run('matlab/baseline_model/data_aggregation.m')
clear

% first-round estimation (uncomment for full, "long" replication)
% % simulated equilibria
% analyst=1; %#ok<*NASGU>
% run('matlab/baseline_model/sim_eq_round1.m')
% clear
% analyst=2;
% run('matlab/baseline_model/sim_eq_round1.m')
% clear
% analyst=3;
% run('matlab/baseline_model/sim_eq_round1.m')
% clear
% analyst=4;
% run('matlab/baseline_model/sim_eq_round1.m')
% clear % to speed up simulations, the above can be parallelized in a cluster environment
% run('matlab/baseline_model/sim_eq_round1_concat.m')
% clear
% % parameter estimation
% run('matlab/baseline_model/parameter_estimates_round1.m')
% clear

% second-round estimation
% % simulated equilibria (uncomment for full, "long" replication)
% analyst=1; %#ok<*NASGU>
% run('matlab/baseline_model/sim_eq_round2.m')
% clear
% analyst=2;
% run('matlab/baseline_model/sim_eq_round2.m')
% clear
% analyst=3;
% run('matlab/baseline_model/sim_eq_round2.m')
% clear
% analyst=4;
% run('matlab/baseline_model/sim_eq_round2.m')
% clear % to speed up simulations, the above can be parallelized in a cluster environment
% run('matlab/baseline_model/sim_eq_round2_concat.m')
% clear
% parameter estimation and inference
run('matlab/baseline_model/parameter_estimates_round2.m') % comment/uncomment "long"/"short" script section accordingly
clear
run('matlab/baseline_model/inference.m') % comment/uncomment "long"/"short" script section accordingly
clear

% model fit
% % simulated equilibria (uncomment for full, "long" replication)
% analyst=1; %#ok<*NASGU>
% run('matlab/baseline_model/sim_eq_final.m')
% clear
% analyst=2;
% run('matlab/baseline_model/sim_eq_final.m')
% clear
% analyst=3;
% run('matlab/baseline_model/sim_eq_final.m')
% clear
% analyst=4;
% run('matlab/baseline_model/sim_eq_final.m')
% clear % to speed up simulations, the above can be parallelized in a cluster environment
% run('matlab/baseline_model/sim_eq_final_concat.m')
% clear
run('matlab/baseline_model/model_fit.m')
clear

% effects of major-power interventions on R's payoffs
run('matlab/baseline_model/average_gamma.m')
clear

% intervention expectations
run('matlab/baseline_model/compute_intervention_expectations.m')
clear

% intervention counterfactuals
% % simulated equilibria (uncomment for full, "long" replication)
% run('matlab/baseline_model/counterfactualUS.m')
% clear
% run('matlab/baseline_model/counterfactualUK.m')
% clear
% run('matlab/baseline_model/counterfactualFR.m')
% clear
% run('matlab/baseline_model/counterfactualRU.m')
% clear
% run('matlab/baseline_model/counterfactualCH.m')
% clear
run('matlab/baseline_model/analyze_intervention_cfs.m')
clear

% equilibrium selection counterfactuals
run('matlab/baseline_model/eq_selection_cfs.m')
clear


%% alternative eq. selec. specification
run('matlab/robustness/eq_selection/eq_selection.m')
clear
run('matlab/robustness/eq_selection/inference.m')
clear


%% Cold War robustness check

% Cold War sample, 1950-1989
run('matlab/robustness/cold_war/data_aggregation_cold_war.m')
clear
run('matlab/robustness/cold_war/cold_war.m')
clear
run('matlab/robustness/cold_war/inference_cold_war.m')
clear

% post-Cold War sample, 1990-1999
run('matlab/robustness/cold_war/data_aggregation_post_cold_war.m')
clear
run('matlab/robustness/cold_war/post_cold_war.m')
clear
run('matlab/robustness/cold_war/inference_post_cold_war.m')
clear


%% multiple civil wars
run('matlab/robustness/multiple_conflicts/multiple.m')
clear
run('matlab/robustness/multiple_conflicts/inference.m')
clear


%% country-decade observations

% averaged covariates
run('matlab/robustness/decade/data_aggregation_decade.m')
clear
run('matlab/robustness/decade/decade.m')
clear
run('matlab/robustness/decade/inference_decade.m')
clear

% initial-valued covariates
run('matlab/robustness/decade/data_aggregation_decade_initial.m')
clear
run('matlab/robustness/decade/decade_initial.m')
clear
run('matlab/robustness/decade/inference_decade_initial.m')
clear


%% intervention measure
run('matlab/robustness/intervention_measure/data_aggregation.m')
clear
run('matlab/robustness/intervention_measure/intervention_measure.m')
clear
run('matlab/robustness/intervention_measure/inference.m')
clear


%% direction of interventions

% aggregate data 1950-1999
run('matlab/robustness/direction/data_aggregation.m')
clear

% first-round estimation (uncomment for full, "long" replication)
% % simulated equilibria
% analyst=1; %#ok<*NASGU>
% run('matlab/robustness/direction/sim_eq_direction_round1.m')
% clear
% analyst=2;
% run('matlab/robustness/direction/sim_eq_direction_round1.m')
% clear
% analyst=3;
% run('matlab/robustness/direction/sim_eq_direction_round1.m')
% clear
% analyst=4;
% run('matlab/robustness/direction/sim_eq_direction_round1.m')
% clear % to speed up simulations, the above can be parallelized in a cluster environment
% run('matlab/robustness/direction/sim_eq_direction_round1_concat.m')
% clear
% % parameter estimation
% run('matlab/robustness/direction/parameter_estimates_direction_round1.m')
% clear

% second-round estimation
% % simulated equilibria (uncomment for full, "long" replication)
% analyst=1; %#ok<*NASGU>
% run('matlab/robustness/direction/sim_eq_direction_round2.m')
% clear
% analyst=2;
% run('matlab/robustness/direction/sim_eq_direction_round2.m')
% clear
% analyst=3;
% run('matlab/robustness/direction/sim_eq_direction_round2.m')
% clear
% analyst=4;
% run('matlab/robustness/direction/sim_eq_direction_round2.m')
% clear % to speed up simulations, the above can be parallelized in a cluster environment
% run('matlab/robustness/direction/sim_eq_direction_round2_concat.m')
% clear
% parameter estimation and inference
run('matlab/robustness/direction/parameter_estimates_direction_round2.m')
clear
run('matlab/robustness/direction/inference.m')
clear

% effects of major-power interventions on R's payoffs
run('matlab/robustness/direction/average_intervention_effects.m')
clear



